home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / wml.vim < prev    next >
Encoding:
Text File  |  2001-05-11  |  5.6 KB  |  157 lines

  1. " Vim syntax file
  2. " Language:     WML
  3. " Maintainer:   Gerfried Fuchs <alfie@ist.org>
  4. " Filenames:    *.wml
  5. " Last Change:  30 Apr 2001
  6. " URL:          http://alfie.ist.org/vim/syntax/wml.vim
  7. "
  8. " Original Version: Craig Small <csmall@eye-net.com.au>
  9. "
  10. " Comments are very welcome - but please make sure that you are commenting on
  11. " the latest version of this file.
  12. " SPAM is _NOT_ welcome - be ready to be reported!
  13.  
  14.  
  15. " For version 5.x: Clear all syntax items
  16. " For version 6.x: Quit when a syntax file was already loaded
  17. if version < 600
  18.   syn clear
  19. elseif exists("b:current_syntax")
  20.   finish
  21. endif
  22.  
  23.  
  24. " A lot of the web stuff looks like HTML so we load that first
  25. if version < 600
  26.   so <sfile>:p:h/html.vim
  27. else
  28.   runtime! syntax/html.vim
  29. endif
  30. unlet b:current_syntax
  31.  
  32. if !exists("main_syntax")
  33.   let main_syntax = 'wml'
  34. endif
  35.  
  36. " Redfine htmlTag
  37. syn clear htmlTag
  38. syn region  htmlTag  start=+<[^/<]+ end=+>+  contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition
  39.  
  40. "
  41. " Add in extra Arguments used by wml
  42. syn keyword htmlTagName contained gfont imgbg imgdot lowsrc
  43. syn keyword htmlTagName contained navbar:define navbar:header
  44. syn keyword htmlTagName contained navbar:footer navbar:prolog
  45. syn keyword htmlTagName contained navbar:epilog navbar:button
  46. syn keyword htmlTagName contained navbar:filter navbar:debug
  47. syn keyword htmlTagName contained navbar:render
  48. syn keyword htmlTagName contained preload rollover
  49. syn keyword htmlTagName contained space hspace vspace over
  50. syn keyword htmlTagName contained ps ds pi ein big sc spaced headline
  51. syn keyword htmlTagName contained ue subheadline zwue verbcode
  52. syn keyword htmlTagName contained isolatin pod sdf text url verbatim
  53. syn keyword htmlTagName contained xtable
  54. syn keyword htmlTagName contained csmap fsview import box
  55. syn keyword htmlTagName contained case:upper case:lower
  56. syn keyword htmlTagName contained grid cell info lang: logo page
  57. syn keyword htmlTagName contained set-var restore
  58. syn keyword htmlTagName contained array:push array:show set-var ifdef
  59. syn keyword htmlTagName contained say m4 symbol dump enter divert
  60. syn keyword htmlTagName contained toc
  61. syn keyword htmlTagName contained wml card do refresh oneevent catch spawn
  62.  
  63. "
  64. " The wml arguments
  65. syn keyword htmlArg contained adjust background base bdcolor bdspace
  66. syn keyword htmlArg contained bdwidth complete copyright created crop
  67. syn keyword htmlArg contained direction description domainname eperlfilter
  68. syn keyword htmlArg contained file hint imgbase imgstar interchar interline
  69. syn keyword htmlArg contained keephr keepindex keywords layout spacing
  70. syn keyword htmlArg contained padding nonetscape noscale notag notypo
  71. syn keyword htmlArg contained onload oversrc pos select slices style
  72. syn keyword htmlArg contained subselected txtcol_select txtcol_normal
  73. syn keyword htmlArg contained txtonly via
  74. syn keyword htmlArg contained mode columns localsrc ordered
  75.  
  76.  
  77. " Lines starting with an # are usually comments
  78. syn match   wmlComment     "^\s*#.*"
  79. " The different exceptions to comments
  80. syn match   wmlSharpBang   "^#!.*"
  81. syn match   wmlUsed        contained "\s\s*[A-Za-z:]*"
  82. syn match   wmlUse         "^\s*#\s*use\s*" contains=wmlUsed
  83. syn match   wmlInclude     "^\s*#\s*include.*"
  84.  
  85. syn region  wmlBody        contained start=+<<+ end=+>>+
  86.  
  87. syn match   wmlLocationId  contained "[A-Za-z]\+"
  88. syn region  wmlLocation    start=+<<+ end=+>>+ contains=wmlLocationId
  89. "syn region  wmlLocation    start=+{#+ end=+#}+ contains=wmlLocationId
  90. "syn region  wmlLocationed  contained start=+<<+ end=+>>+ contains=wmlLocationId
  91.  
  92. syn match   wmlDivert      "\.\.[a-zA-Z_]\+>>"
  93. syn match   wmlDivertEnd   "<<\.\."
  94. " new version
  95. "syn match   wmlDivert      "{#[a-zA-Z_]\+#:"
  96. "syn match   wmlDivertEnd   ":##}"
  97.  
  98. syn match   wmlDefineName  contained "\s\+[A-Za-z-]\+"
  99. syn region  htmlTagName    start="\<\(define-tag\|define-region\)" end="\>" contains=wmlDefineName
  100.  
  101. " The perl include stuff
  102. if main_syntax != 'perl'
  103.   " Perl script
  104.   if version < 600
  105.     syn include @wmlPerlScript <sfile>:p:h/perl.vim
  106.   else
  107.     syn include @wmlPerlScript syntax/perl.vim
  108.   endif
  109.   syn region perlScript   start=+<perl>+ keepend end=+</perl>+ contains=@wmlPerlScript,wmlPerlTag
  110. " eperl between '<:' and ':>'  -- Alfie [1999-12-26]
  111.   syn region perlScript   start=+<:+ keepend end=+:>+ contains=@wmlPerlScript,wmlPerlTag
  112.   syn match    wmlPerlTag  contained "</*perl>" contains=wmlPerlTagN
  113.   "syn match   wmlPerlTag  contained "</perl>" contains=wmlPerlTagN
  114.   syn keyword  wmlPerlTagN contained perl
  115.  
  116.   hi link   wmlPerlTag  htmlTag
  117.   hi link   wmlPerlTagN htmlStatement
  118. endif
  119.  
  120. if main_syntax == "html"
  121.   syn sync match wmlHighlight groupthere NONE "</a-zA-Z]"
  122.   syn sync match wmlHighlight groupthere perlScript "<perl>"
  123.   syn sync match wmlHighlightSkip "^.*['\"].*$"
  124.   syn sync minlines=10
  125. endif
  126.  
  127. " Define the default highlighting.
  128. " For version 5.7 and earlier: only when not done already
  129. " For version 5.8 and later: only when an item doesn't have highlighting yet
  130. if version >= 508 || !exists("did_wml_syn_inits")
  131.   let did_wml_syn_inits = 1
  132.   if version < 508
  133.     let did_wml_syn_inits = 1
  134.     command -nargs=+ HiLink hi link <args>
  135.   else
  136.     command -nargs=+ HiLink hi def link <args>
  137.   endif
  138.  
  139.   HiLink wmlUse         Include
  140.   HiLink wmlUsed        String
  141.   HiLink wmlBody        Special
  142.   HiLink wmlDiverted    Label
  143.   HiLink wmlDivert      Delimiter
  144.   HiLink wmlDivertEnd   Delimiter
  145.   HiLink wmlLocationId  Label
  146.   HiLink wmlLocation    Delimiter
  147. " HiLink wmlLocationed  Delimiter
  148.   HiLink wmlDefineName  String
  149.   HiLink wmlComment     Comment
  150.   HiLink wmlInclude     Include
  151.   HiLink wmlSharpBang   PreProc
  152.  
  153.   delcommand HiLink
  154. endif
  155.  
  156. let b:current_syntax = "wml"
  157.